import { extend } from "vee-validate"
import {required} from "vee-validate/dist/rules"
// 手机号验证规则
extend("phone", {
    validate(val) {
      // val就是表单项的值
      // 返回true，代表校验通过
      return /^1[3-9][0-9]{9}$/.test(val);
    },
    message: "* 手机号不合法",
  });
extend("phoneRequired", {
...required,
message: "* 请输入手机号",
});

  //检验密码格式
extend("password", {
    validate(val) {
      return /^[a-zA-Z0-9_]{6,18}$/.test(val);
    },
    message: "* 密码不复合要求",
  });
extend("passwordRequired", {
...required,
message: "* 请输入密码",
});
